package com.authentication.center.controller;

import com.authentication.center.service.AuthService;
import com.linzf.common.util.RtnMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 类描述：实现鉴权的controller
 * @author linzf
 */
@RestController
@RequestMapping("/auth")
public class AuthController {

    @Autowired
    private AuthService authService;

    /**
     * 功能描述：实现对路由地址的鉴权
     * @Param auth 由authUrl 当前响应的地址和token当前的token两个参数组成
     * @return
     */
    @PostMapping("authUrl")
    public RtnMsg authUrl(@RequestBody Map<String,String> auth){
        return authService.authUrl(auth);
    }


}
